//
//  VCImageView.m
//  VideoCollage
//
//  Created by Mac on 2018/6/28.
//  Copyright © 2018年 stoneobs.qq.com. All rights reserved.
//

#import "VCImageView.h"

@implementation VCImageView
- (instancetype)init
{
    self = [super init];
    if (self) {

    }
    return self;
}
- (instancetype)initWithImage:(UIImage *)image{
    if (self == [super initWithImage:image]) {

    }
    return self;
}
- (BOOL)isNotChosed{
    NSData * data = UIImageJPEGRepresentation(self.image, 1);
    NSData * defultdata = UIImageJPEGRepresentation(DefultAddImage, 1);
    if ([data isEqual:defultdata]) {
        return YES;
    }
    return NO;
}
- (void)setImage:(UIImage *)image{
    [super setImage:image];
    //未选择图片设置虚线边框
    NSData * data = UIImageJPEGRepresentation(image, 1);
    NSData * defultdata = UIImageJPEGRepresentation(DefultAddImage, 1);
    if ([data isEqual:defultdata]) {
        self.contentMode = UIViewContentModeCenter ;
         [self st_setDottedLineBrderWidth:1 borderColor:TM_lineColor];
    }else{
        self.contentMode = UIViewContentModeScaleAspectFill;
         [self st_setDottedLineBrderWidth:1 borderColor:UIColor.clearColor];
    }
}

@end
